package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.SaleCountBean;
import com.project.dao.ISaleCountDao;
import com.project.service.ISaleCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;

/**
 * @author lyl
 * description:销售统计业务接口
 */
@Service
@Transactional
public class SaleCountServiceImpl implements ISaleCountService {
    @Autowired
    private ISaleCountDao iSaleCountDao;

    @Override
    public PageInfo<SaleCountBean> findByPage(int pageNum, String factory, LocalDate startDate, LocalDate endDate) {
        PageHelper.startPage(pageNum, 3);
        PageInfo<SaleCountBean> info = PageInfo.of(iSaleCountDao.findByPage(factory, startDate, endDate));
        return info;
    }
}
